<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('订单列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">

        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">

    var removeFlag = [[${@permission.hasPermi('system:orders:remove')}]];
    var prefix = ctx + "system/user/orders";

    $(function () {
        var options = {
            url: prefix + "/myList",
            createUrl: prefix + "/add",
            readUrl: prefix + "/read/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "",
            columns: [{
                checkbox: true
            }, {
                field: 'orderNumber',
                title: '订单编号',
                formatter: function (value, row, index) {
                    var num = index + 1;
                    var str = num.toString();
                    while (str.length < 6) {
                        str = '0' + str;
                    }
                    return 'NR' + str;
                }
            },
                {
                    field: 'orderAmount',
                    title: '订单金额'
                },
                {
                    field: 'orderCustomer',
                    title: '买单客户'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="$.operate.read(\'' + row.id + '\')"><i class="fa fa-edit"></i>查看</a> ');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });
</script>
</body>
</html>